import pygtk
pygtk.require('2.0')
import gtk
from gtk import glade


class MyWin(object):
    def __init__(self):
        self.a = glade.XML('prueba.glade')
        self.w= self.a.get_widget("window1")
        self.a.autoconnect(self)
    
    def on_window1_destroy(self, evt):
        self.quit()
        
    def on_textview1_key_press_event(self, evt, params):
        print params
    
    def quit(self):
        gtk.main_quit()


window = MyWin()
gtk.main()
